package com.yonghui.sandbox.controller;

import com.yonghui.sandbox.common.ResponseResultVO;
import com.yonghui.sandbox.service.ChildService;
import com.yonghui.sandbox.vo.ChildVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description: TODO
 * @author: zhangtong
 * @create: 2021-03-15 15:41
 **/
@RestController
@RequestMapping("/child")
public class ChildController {

    @Autowired
    private ChildService childService;

    @RequestMapping(value = "/getChild")
    public ResponseResultVO getChild(String name){
        childService.getChildMethod(name);
        return ResponseResultVO.success();
    }


    @RequestMapping(value = "/getAsyncChild")
    public ResponseResultVO getAsyncChild(String name){
        ChildVO asyncChild = childService.getAsyncChild(name);
        return ResponseResultVO.success(asyncChild);
    }

}
